#include "./WizInnerMemoryAllocatorLoki.hpp"


namespace Wiz
{
    namespace Inner
    {
        namespace Memory
        {
            namespace Allocator
            {
                namespace Loki
                {
                    ::Wiz::Inner::Memory::Allocator::Loki::Chunk::FixedPtr
                        Type::NewChunk(::Wiz::Size8::In EleSz, ::Wiz::Count8::In EleCnt)
                    {
                        tChunkFixedPtr NewChunkPtr = new tChunk(EleSz, EleCnt);
                        if (NotValidPtr(NewChunkPtr))
                        {
                            return WIZ_NULLPTR;
                        }

                        m_ChunkMap.Insert(tChunkProxy(*NewChunkPtr), NewChunkPtr);

                        return NewChunkPtr;
                    }

                    ::Wiz::Inner::Memory::Allocator::Loki::Chunk::FixedPtr
                        Type::FindChunk(::Wiz::UInt8::Ptr InU8Ptr)
                    {
                        tMap::tIterator Itr = m_ChunkMap.Find(tChunkProxy(InU8Ptr));

                        return Itr.GetValue();
                    }
                } /// end of namespace Loki
            } /// end of namespace Allocator
        } /// end of namespace Memory
    } /// end of namespace Inner
} /// end of namespace Wiz

